package callback;

public class PointFrame {
    public static void  drawFrame(IMyFrame f){
        System.out.println("启动线程");
        System.out.println("增加循环");
        System.out.println("查看消息栈");

        //画窗口
        f.paint();

        System.out.println("启动缓存，增加效率");
    }
    public static void main(String[] args){
        drawFrame(new GameFrame02());
    }
}
//继承
//class GameFrame01 extends MyFrame{
//    public void paint(){
//        System.out.println("GameFrame01画窗口");
//    }
//}
//class GameFrame02 extends MyFrame{
//    public void paint(){
//        System.out.println("GameFrame02画窗口");
//    }
//}

//接口
class GameFrame01 implements IMyFrame{
    public void paint(){
        System.out.println("GameFrame01画窗口");
    }
}
class GameFrame02 implements IMyFrame{
    public void paint(){
        System.out.println("GameFrame02画窗口");
    }
}